Skip to content

Studio tests: delegate.test.mjs splits into four files, so the node tests run in parallel (#822) - #829

Merged
danielrispler merged 2 commits into
mainfrom
issue-822-studio-tests-delegate-test
Nov 28, 2026
Merged

danielrispler merged 2 commits into
mainfrom
issue-822-studio-tests-delegate-test

Conversation

@danielrispler

@danielrispler danielrispler commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

Closes #822.

Summary

 ui/tests/
-├── delegate.test.mjs                 # 52 tests, 31.5 s, run one after another
+├── delegate-fixtures.mjs             # stand-ins (agy, opencode, npm, gh, herdr), pickCritic, scratchRun, commitsOn, gone
+├── delegate-critic.test.mjs          # pick critic: 14 tests
+├── delegate-run-candidates.test.mjs  # run: models started, silent ones marked out, lingering process, could not start: 9
+├── delegate-run-verdicts.test.mjs    # run: escalate, the one retry, stop, Route outcome: 15
+└── delegate-run-worktree.test.mjs    # run: the commit, brief and env, launching checkout, Herdr: 14

A move, not a rewrite. The sorted lines of the old file match the sorted lines of the five new ones, apart from the header comments, the imports and export on script, pickCritic, scratchRun, commitsOn and gone. The same 52 test names, checked by diffing the TAP names. No case was merged, dropped or made async. Helpers that only one file uses (two, models, HEALTHY_SILENCE_MS, bare, ranCritic, BRIEFED, BREAKDOWN) stay in that file. docs/studio/development.md now lists the new shared module. system-map check passes with no map change, since files under tests/ give no pair.

No test was removed or merged, so the "replace narrower tests" list is empty.

Evidence

Daniel's Mac, Node v22.23.1, 10 cores, measured at 8a3b2c10b and on this branch:

file, alone wall
delegate.test.mjs (before) 31.5 s
delegate-critic.test.mjs 3.1 s
delegate-run-candidates.test.mjs 10.4 s
delegate-run-verdicts.test.mjs 11.4 s
delegate-run-worktree.test.mjs 10.8 s

The three run: files are within 10% of each other. The critic file is its own file, as the ticket says.

npm run test:node, before and after back to back, twice (848 tests, 0 failed in each run):

run 1 run 2
before 38.4 s 38.5 s
after 15.2 s 16.7 s

That is 57–60% shorter. The ticket asked for at least 40%.

The macOS CI job's node phase # duration_ms: before 57875 (run 46163503163), after 18068 (this PR's run 46168520750), 69% shorter.

snap (1/2) failed once on a fixture this diff doesn't touch (mapScan: cli's plate is cut by the canvas's edge). One rerun of the failed job (gh run rerun 46168520685 --failed) passed.

npm run check passes (knip, Biome, tsc -p ui/tests, system-map check).

Merge Danger

Door: two-way. Revert brings the one file back.

Blast Radius: tests. Only ui/tests/ and one docs line change. package.json, --test-concurrency and scripts/agents/delegate.mjs are untouched.

Correctness pass and Outside review

Correctness pass: skipped. The PR changes no Rust or TypeScript, only JavaScript test files moved unchanged. The two-axis /code-review (standards and spec) found no defects. Its notes:

  • The lingering-process case's file header didn't name it. Fixed in the header.
  • development.md didn't list the shared module. Fixed.
  • "fixtures" is a loose name for the module. Rejected: the ticket names it.

Outside review: skipped: no risk match

🤖 Generated with Claude Code

danielrispler and others added 2 commits November 28, 2026 19:01
…ests run in parallel (#822)

The stand-ins, scratchRun, pickCritic and the shared helpers move to
ui/tests/delegate-fixtures.mjs; the cases move unchanged into
delegate-critic, delegate-run-candidates, delegate-run-verdicts and
delegate-run-worktree. Same 52 tests, same names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s case, and development.md lists delegate-fixtures.mjs (#822)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@danielrispler
danielrispler merged commit af4edaa into main Nov 28, 2026
5 of 6 checks passed
@danielrispler
danielrispler deleted the issue-822-studio-tests-delegate-test branch November 28, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Studio tests: delegate.test.mjs splits into four files, so the node tests run in parallel (#803)

1 participant